<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>新闻添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../style/wangeditor.css">
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加信息':action=='Modify'?'查看信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'news', 'form': 'dataForm' ,'primary_key':'News_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">新闻信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">新闻标题</div>
              </template>
              <el-form-item prop="News_Title" :rules="[{ required: true, message: '请输入新闻标题', trigger: 'blur' }]">
                <el-input disabled ref="personal_information" v-model="dataForm.News_Title" class="borderless-input"
                  placeholder="请输入新闻标题" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">展示终端选择</div>
              </template>
              <el-select disabled @change="handleChange" multiple clearable
                v-model.trim="dataForm.NewsTerminal" placeholder="请输入展示终端选择" filterable style="width: 100%">
                <el-option v-for="(item,index) in NewsTerminal" :key="index" :label="item.label"
                  :value="item.value"></el-option>
              </el-select>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">新闻类型</div>
              </template>
              <el-form-item prop="News_Category_SerialNumber"
                :rules="[{ required: true, message: '请选择新闻类别', trigger: 'change' }]">
                <el-cascader disabled @change="changeCategory" class="borderless-input"
                  style="width: 100%;" v-model="dataForm.News_Category_SerialNumber" placeholder="请选择新闻类别"
                  :options="category"
                  :props="{ value:'News_Category_SerialNumber', label:'News_Category' ,checkStrictly: true , emitPath:false}"></el-cascader>
                <!-- <el-select clearable v-model.trim="dataForm.News_Category_SerialNumber" placeholder="请选择新闻类别" filterable
                  style="width: 100%">
                  <el-option v-for="(item,index) in category" :key="index" :label="item.News_Category"
                    :value="item.News_Category_SerialNumber"></el-option>
                </el-select> -->
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item
              v-if="dataForm.News_Category_SerialNumber == 'NC0000000000036'||category1.some(i=>i.Parent_SerialNumber=='NC0000000000036'&&i.News_Category_SerialNumber==dataForm.News_Category_SerialNumber)">
              <template #label>
                <div class="cell-item">所属党组织</div>
              </template>
              <el-form-item prop="Party_Organization_Activity_SerialNumber">
                <yl-cascader disabled v-model="dataForm.Party_Organization_Activity_SerialNumber" placeholder="请选择党组织"
                  :options="party_organization"
                  :props="{ value:'Party_Organization_SerialNumber', label:'Party_Organization_Name' ,checkStrictly: true }"></yl-cascader>
                <!-- <el-select clearable v-model.trim="dataForm.Party_Organization_Activity_SerialNumber" placeholder="请选择党组织" filterable
                  style="width: 100%">
                  <el-option v-for="(item,index) in party_organization" :key="index" :label="item.Party_Organization_Name"
                    :value="item.Party_Organization_SerialNumber"></el-option>
                </el-select> -->
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">新闻封面图片</div>
              </template>
              <el-form-item prop="News_Image_URL" :rules="[{ required: true, message: '请上传封面图', trigger: 'blur' }]">
                <el-image  :src="photo + dataForm.News_Image_URL" style="width: 150px;height: 150px; border-radius: 5px;"></el-image>
              </el-form-item>
            </el-descriptions-item>
            <!-- <el-descriptions-item>
              <template #label>
                <div class="cell-item">是否在小程序上展示</div>
              </template>
              <el-select v-model.trim="dataForm.Environment_MicroScreen" placeholder="请选择是否在小程序上展示" filterable
                style="width: 100%">
                <el-option v-for="(item,index) in [{label:'是',value:'0'},{label:'否',value:'1'}]" :key="index"
                  :label="item.label" :value="item.value"></el-option>
              </el-select>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">是否在大屏上展示</div>
              </template>
              <el-select v-model.trim="dataForm.Environment_BigScreen" placeholder="请选择是否在大屏上展示" filterable
                style="width: 100%">
                <el-option v-for="(item,index) in [{label:'是',value:'0'},{label:'否',value:'1'}]" :key="index"
                  :label="item.label" :value="item.value"></el-option>
              </el-select>
            </el-descriptions-item> -->
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">新闻内容</div>
              </template>
              <el-form-item prop="News_Content" :rules="[{ required: true, message: '请输入新闻标题', trigger: 'blur' }]">
                <yl-text-editor disabled v-model="dataForm.News_Content" placeholder="请输入新闻内容"></yl-text-editor>
              </el-form-item>
            </el-descriptions-item>
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">新闻标签</div>
            <!-- <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove1('childDataForm')">删除</el-button>
            </div> -->
          </div>
          <el-form :model="{childDataForm}" ref="form1" inline-message="true" style="width: 100%">
            <el-descriptions
              :data-options="JSON.stringify({ 'TableName': 'news_mapping_tags', 'form': 'childDataForm', 'ParentTableName': 'news'})"
              :column="3" size="large" border>
              <el-descriptions-item v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')"
                :key="index">
                <template #label>
                  <div class="cell-item">标签{{index + 1}}</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.News_Tag_SerialNumber'"
                  :rules="[{ required: true, message: '请输入新闻标题', trigger: 'blur' }]">
                  <el-select disabled clearable v-model.trim="item.News_Tag_SerialNumber" placeholder="请选择新闻标签" filterable
                    style="width: 100%">
                    <el-option v-for="(item,index) in news_tags" :key="index" :label="item.News_Tag"
                      :value="item.News_Tag_SerialNumber"></el-option>
                  </el-select>
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
          <div class="table_titel">
            <div class="titel">新闻图片</div>
            <!-- <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm1')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove1('childDataForm1')">删除</el-button>
            </div> -->
          </div>
          <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'news_picture', 'form': 'childDataForm1', 'ParentTableName': 'news'})"
            :column="2" size="large" border
            v-for="(item,index) in childDataForm1.filter(item => item.Row_Status != '1')" :key="index">
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">图片</div>
              </template>
              <el-image  :src="photo + dataForm.News_Piciture_URL" style="width: 150px;height: 150px; border-radius: 5px;"></el-image>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">排序序号</div>
              </template>
              <el-input disabled ref="personal_information" v-model="item.Picture_Order" class="borderless-input"
                placeholder="请输入排序序号" />
            </el-descriptions-item>
          </el-descriptions>
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <!-- <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button> -->
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>